package com.quartz.monitor4job.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import com.quartz.monitor4job.dao.mapper.QuartzJobMapper;
import com.quartz.monitor4job.model.QuartzJob;
import com.quartz.monitor4job.service.QuartzService;

/**
 * 
 * @author LIPENG
 *
 * @date 2017年5月5日 下午3:59:33
 *
 * @version V1.0
 */
@Service("quartzService")
public class QuartzServiceImpl implements QuartzService {
	private static final Logger logger = LoggerFactory.getLogger(QuartzServiceImpl.class);
	@Resource
    private QuartzJobMapper quartzJobMapper;
	@Override
	public List<QuartzJob> listJobs(QuartzJob quartzJob) {
		return quartzJobMapper.list(quartzJob);
	}

	@Override
	public void runJob(QuartzJob job) {
		logger.info("执行选择的Job对象 doRunSimsJob runName:" + job);
        try {
        } catch (Exception e) {
            logger.error("doRunSimsJob 执行选择的Job对象出错", e);
        }
	}

	@Override
	public QuartzJob getJobDetail(QuartzJob job) {
		return quartzJobMapper.getJobDetail(job);
	}

}
